<?php 
class ModelShippingPickup extends Model {    
  	public function getQuote($country_id, $zone_id, $postcode = '') {
		$this->load->language('shipping/pickup');
		$log = new logger("a.txt");
		$quote_data = array();

		if ($this->config->get('pickup_status')) { {
			$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "geo_zone ORDER BY name");
		
			foreach ($query->rows as $result) {
   				if ($this->config->get('pickup_' . $result['geo_zone_id'] . '_status')) {
   					$status = TRUE;
				} else {
					$status = FALSE;
				}
			
				if ($status) {
					$cost = 0;
					$quote_data['pickup_' . $result['geo_zone_id']] = array(
        					'id'           => 'pickup.pickup_' . $result['geo_zone_id'],
        					'title'        => $this->language->get('title_beginning').$this->config->get('pickup_' . $result['geo_zone_id'] . '_address'),
        					'cost'         => $cost,
        					'tax_class_id' => $this->config->get('pickup_tax_class_id'),
        					'text'         => $this->currency->format($this->tax->calculate($cost, $this->config->get('config_tax_class_id'), $this->config->get('config_tax')))
      					);	
				}
			}
		}
		
		$method_data = array();
	
		if ($quote_data) {
      		$method_data = array(
        		'id'         => 'pickup',
        		'title'      => $this->language->get('text_title'),
        		'quote'      => $quote_data,
				'sort_order' => $this->config->get('pickup_sort_order'),
        		'error'      => FALSE
      		);
		}
	
		return $method_data;
  	}
}}
?>